package com.chinasofti.list;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;

public class Demo03 {
    public static void main(String[] args) {
        LinkedList<String>list = new LinkedList<>();
        list.add("aaa");
        list.add("bbb");
        list.add("ccc");
        Iterator<String> it = list.iterator();
        while (it.hasNext()){
            String s=it.next();
            System.out.println("s = " + s);
        }
        for (String s :list){
            System.out.println("s = " + s);
        }

    }
}
